import request from '@/utils/request'

export const getOndutyMsg = (params) => {
  return request({
    url: '/v1/departmentWork/ondutyMsg/',
    method: 'get',
    params,
  })
}

// 修改信息
export const updateOndutyMessag = (data) => {
  return request({
    url: '/v1/departmentWork/ondutyMsg/',
    method: 'put',
    data,
  })
}

// 删除信息
export const deleteOndutyMessag = (rid) => {
  return request({
    url: '/v1/departmentWork/ondutyMsg/',
    method: 'delete',
    params: { rid },
  })
}

// 文件上传
export const fileUpdateMyOndutyMsg = (data) => {
  return request({
    url: '/v1/departmentWork/ondutyMsg/my/fileUpdate/',
    method: 'post',
    data
  })
}

// 手动添加值班信息
export const addMyOndutyMsg = (data) => {
  return request({
    url: '/v1/departmentWork/ondutyMsg/my/',
    method: 'post',
    data
  })
}

// 查询登录用户查询值班信息
export const getMyOndutyMsg = (params) => {
  return request({
    url: '/v1/departmentWork/ondutyMsg/my/',
    method: 'get',
    params
  })
}

// 删除值班信息
export const deleteMyOndutyMsg = (data) => {
  return request({
    url: '/v1/departmentWork/ondutyMsg/my/',
    method: 'delete',
    data: data
  })
}

// 统计值班信息
export const getOndutyStatistics = (params) => {
  return request({
    url: '/v1/departmentWork/ondutyMsg/statistics/',
    method: 'get',
    params
  })
}

// 按月
export const sOndutyMessageMonthly = (params) => {
  return request({
    url: '/v1/departmentWork/ondutyMsg/statisticsMonthly/',
    method: 'get',
    params,
  })
}
